package org.springbus.ff.core;


import org.springbus.ff.animate.AniFilter;
import org.springbus.ff.conf.FFBaseConf;
import org.springbus.ff.filter.Filter;
import org.springbus.ff.node.FFCon;
import org.springbus.ff.node.FFNode;
import org.springbus.ff.util.Utils;

import java.io.File;
import java.util.List;
import java.util.UUID;

public class FFBase {
    private  static  int  uuid=1;
    public FFBaseConf conf;
    public String type;
    public String showType;

    public boolean hasInput;
    public boolean isFFAni;
    public AniFilter filter;
    public  String id="";
    public  int index=0;

    public FFBase parent;
    protected int percent;

    public FFBase(FFBaseConf conf,String type) {
        this.conf = conf;
        this.type = type;
        this.parent = null;
        genId();
    }

    // Method to generate unique id

    public  void genId() {
        this.id = Utils.genId(type);
    }

    // Method to get the logical root node of the instance
    public FFBase root() {
        return this.parent != null ? this.parent.root() : this;
    }

    public static double floor(int n, int s) {
        double k = Math.pow(10, s);
        return Math.floor(n * k) / k;
    }

    public static double floor(int n) {
        return floor(n, 2);
    }

    public void addOptions(FFCommand command) {

    }

    public void addOutput(FFCommand command) {

    }

    public void addInput(FFCommand command) {

    }

    public List<Object> concatFilters(FFContext context) {
        return null;
    }

    public boolean isReady() {
        return true;
    }
}